// 2025/9/24
// 除2!

#include <iostream>
#include <queue>
using namespace std;

int main() {
    long long n, k, tmp, ans = 0; 
    cin >> n >> k;
    priority_queue<long long> heap;
    while(n--)
    {
        cin >> tmp;
        if(tmp % 2 == 0)
            heap.emplace(tmp);
        else
            ans += tmp;;
    }
    while(k-- && !heap.empty())
    {
        long long even = heap.top() / 2;
        heap.pop();
        if(even % 2 == 0)
            heap.emplace(even);
        else
            ans += even;
    }
    while(!heap.empty())
    {
        ans += heap.top();
        heap.pop();
    }
    cout << ans << endl;
}
// 64 位输出请用 printf("%lld")